<?php
namespace app\admin\middleware;
use app\admin\validate\ProductCategory as ProductategoryValidate;


class ProductCategory 
{
    public function handle($request, \Closure $next)
    {
        $params =$request->param();
        $action=$request->action();
        echo $action;
       // die;
       if($action!='index'){
            $scene=validate(ProductategoryValidate::class)->scene($action);
            $scene->check($params);
            $params=$scene->getDateByRule($params);
            $request->params=$params;
        }
        return $next($request);
    }
    
}